<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
<div region="center" style="padding: 1px;">
<t:datagrid name="publicAccountInfoList" title="对公客户信息查询" onLoadSuccess="onLoadSuccess" autoLoadData="false" actionUrl="judicialControll.do?publicAccountInfoQuery" fitColumns="true"
	idField="id" fit="true" queryMode="group" showText="true">
	<%--   update-end--Author:tanghan  Date:20130713 for添加checkbox--%>
	<t:dgCol title="账号" field="acctno"  query="true" hidden="false"></t:dgCol>
	<t:dgCol title="户名" field="custcn" query="true" frozenColumn="true"  width="180"></t:dgCol>
	<t:dgCol title="客户号"  field="custno" query="true"  width="100"></t:dgCol>
	<t:dgCol title="账户状态" field="acctst" dictionary="acctst"  query="true" hidden="true" width="60"></t:dgCol>
	
	<t:dgCol title="rowkey" field="rowkey" hidden="true" width="120"></t:dgCol>
	<t:dgCol title="子户号" sortable="false" field="subsac"  width="120"></t:dgCol>
	<t:dgCol title="币种" field="crcycd" width="120"></t:dgCol>
	<t:dgCol title="证件类型" field="certtp" width="150"  dictionary="certtp" query="true" hidden="true"></t:dgCol>
	<t:dgCol title="证件号码" field="certno" width="150" query="true" hidden="true"></t:dgCol>
	<t:dgCol title="账户余额" field="lastbl"   hidden="true" queryMode="group" width="200"></t:dgCol>
	<t:dgCol title="可用余额" field="avabl" width="200"></t:dgCol>
	<t:dgCol title="存期" sortable="false" field="termcd" width="80"></t:dgCol>
	<t:dgCol title="开户日期" field="opendt"  width="120"></t:dgCol>
	<t:dgCol title="销户日期" field="closdt"   width="120"></t:dgCol>
	<t:dgCol title="开户机构" field="brhnm"  width="60"></t:dgCol>
	
	<t:dgCol title="结算标志" field="balflag" width="120"></t:dgCol>
	<t:dgCol title="储种" field="debttp" width="60"></t:dgCol>
	
	
	<t:dgToolBar title="导出Excel" icon="icon-search" onclick="publicAccountInfoListExportXls();"></t:dgToolBar>

</t:datagrid></div>
</div>
<script type="text/javascript">
    function isNull(pa){
	  var resp='';
	  if(pa ==null || pa==''){
	    resp+=';';
	  }else{
	  	resp+=pa+ ';';
	  }
	   return resp;
	}
    function getParams(){
		var param;
        var custcn= $("input[name='custcn']").val();
	    var acctno= $("input[name='acctno']").val();
	    var certtp= $("select[name='certtp']").val();
	    var certno= $("input[name='certno']").val();
	    var acctst = $("select[name='acctst']").val();
	    var custno= $("input[name='custno']").val();
	    var eplytg= $("input[name='eplytg']").val();
	    
	    param = isNull(custno) + isNull(acctno) + isNull(certno) + isNull(acctst) + isNull(eplytg)  + isNull(certtp)
	                  + isNull(custcn);
        return param;	                  
	    
    }
    
    function onLoadSuccess(){
       var startkey = getrowkey(1);
       var endkey = getrowkey(0);
       $('#publicAccountInfoList').datagrid('options').queryParams={'startkey':startkey,'endkey':endkey,'param':getParams()};
       
    }
    function getrowkey(flag){
        var  rowkey;
    	var datas = $('#publicAccountInfoList').datagrid('getRows');
    	var le ;
    	if(flag==0){//下一页
    	   le = $('#publicAccountInfoList').datagrid('getData').rows[datas.length-1];
    	}else if(flag==1){//上一页
    	   le = $('#publicAccountInfoList').datagrid('getData').rows[0];
    	}else{
    	  le ='';
    	  return '';
    	}
    	if(null != le && le !=''){
	    	for(var i in le){
	    		if(i=='rowkey'){
	    			rowkey=le[i];
    				return rowkey;
	    		}
	    	}
    	}
    }
    function publicAccountInfoListExportXls(){
    	var param = getParams();
    	JeecgExcelExport('judicialControll.do?publicAccountInfoDown&param='+param,'publicAccountInfoList');
    }
   function perPubAccountDetailsearch(){
    	var param = getParams();
    	$('#publicAccountInfoList').datagrid({
    		url: 'judicialControll.do?publicAccountInfoQuery&param='+param+'&field=acctno,custcn,rowkey,custno,rowkey,subsac,crcycd,certtp,certno,lastbl,avabl,termcd,opendt,closdt,brchno,acctst,spectp,balflag,debttp,brhnm,'
    	});
    }
</script>